const { log } = require('console')
const fs = require('fs')
const path = require('path')
const url = path.join(__dirname,'./info.json')
const data =JSON.parse(fs.readFileSync(url,'utf-8'))
// console.log(data);
const user = data[Math.floor(Math.random()*data.length)]
console.log(user);
// const res = data.reduce((piv,civ) => {
//     return piv+civ.count
// },0)
user.count ++
// console.log(res);
fs.writeFileSync('./info.json',`${JSON.stringify(data)}`)